package com.itheima.day01.kehouzuoye;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;

public class MyDemo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<String> arr = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            System.out.println("请输入书名");
            arr.add(sc.next());
        }
        Iterator<String> iterator = arr.iterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);
        }
        System.out.println("-------------------");
        for (String s : arr) {
            if (s.length() < 10) {
                System.out.println(s);
            }
        }
        System.out.println("-------------------");
        for (String s : arr) {
            if (s.contains("Java")) {
                System.out.println(s);
            }
        }
        System.out.println("-------------------");
        Iterator<String> it = arr.iterator();
        while (it.hasNext()) {
            String next = it.next();
            if(next.contains("Oracle")){
                it.remove();
            }
            System.out.println(next);

        }

    }
}

